#ifndef MEDIAFACTORY_H
#define MEDIAFACTORY_H

#include <QObject>
#include <QSqlQuery>
#include <QSharedPointer>

#include "movie.h"

class MediaFactory : public QObject
{
    Q_OBJECT
public:
    explicit MediaFactory(QObject *parent = 0);

    ///
    /// @param  flags       The DataFlags for the movie i.g Images etc.
    ///
    /// Set the DataFlags which be selcted
    //inline void setDataFlags(DataFlags flags) { dataFlags_ = flags; }

    ///
    /// @return     The media list
    ///
    /// Returns the media list
    MovieList &getData();

    ///
    /// @param  id      The internal database id of the movie
    ///
    /// Creates the movie object for an id and returns the pointer to it
    static Movie *movie(int id);

private:
    ///
    /// Preparing to build all nessesary objects
    void fetchObjects();

    MovieList movieList_;           ///< Holds the result MovieList
};

#endif // MEDIAFACTORY_H
